package com.ktmall.ktmalluijava.mapper;

import com.ktmall.ktmalluijava.pojo.Address;
import com.ktmall.ktmalluijava.pojo.Cart;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface AddressMapper {
    /**
     * 条件分页查询
     * @param username
     * @param telName
     * @param telNumber
     * @param pageNo
     * @param offset
     * @return
     */
    List<Address> select(@Param("username") String username, @Param("telName") String telName, @Param("telNumber") String telNumber,
                         @Param("pageSize") Integer pageNo , @Param("offset") Integer offset);

    /**
     * 获取总记录数
     * @param username
     * @param userName
     * @param telNumber
     * @return
     */
    int count(@Param("username") String username, @Param("userName") String userName,@Param("telNumber") String telNumber);

    /**
     * 逻辑删除
     * @param id
     * @return
     */
    @Update("update t_address set enabled = 1 where id = #{id}")
    int delete(Integer id);
}
